package org.uim.cricket.storage.raise;

import org.uim.cricket.db.impl.ExistPlayer;
import org.uim.cricket.entities.Official;
import org.uim.cricket.entities.match.CricketMatch;
import org.uim.cricket.storage.Dlogger;
import org.uim.cricket.storage.StorageBeans;

public class CheckForOfficial {

	public String raiseOfficial(CricketMatch match, Official o) throws Exception {
		if (o == null) return "";
		ExistPlayer exist = new ExistPlayer(o.getId(), o.getTitleName());
		if (!exist.exists()) {
			Dlogger.debug("  [New Official]: #" + o.getId() + " - " + o.getTitleName());
			return new InsertNewOfficial(StorageBeans.getInstance().fetchResObj(), match, o).raise();
		}
		return "";
	}
	
}
